home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Resource for Source: C/C++
/
Resource for Source - C-C++.iso
/
codelib6
/
v_08_11
/
8n11051b
< prev
next >
Wrap
Text File
|
1995-11-01
|
527b
|
17 lines
int msqid; /* Message queue identifier */
key_t key=0x1024; /* Name of message queue */
if ((msqid=msgget(key, 0660 | IPC_CREAT | IPC_EXCL)) == -1) {
/* Can't create a new message queue. One already
* exists by the same name. It is possible another
* process is using the same key to get a message
* queue. This prevents us from stepping on each
* other.
*/
fprintf(stderr,"Message queue already exists\n");
return(-1);
}